*** REPLICATION TOOLKIT ***

* AUTHORS: CIMINELLI DUVAL FURCERI 

* ARTICLE: EMPLOYMENT PROTECTION DEREGULATION AND LABOR SHARES IN ADVANCED ECONOMIES 

* JOURNAL: REVIEW OF ECONOMICS AND STATISTICS

* OUTPUT: FIGURE 2, PANEL A

***************************

cd ""

global horizon 6 
global ci = 1.6

use "DTA files/Dataset strikes - country level", clear

************* CLEAN DATASET ******************

xtset ifscode year

************ PREPARE VARIABLES **********

* Disputes days lost
tssmooth ma Y = DisputesDaysLost, window(2 1 2) replace
replace Y = Y/H_EMP

* Dependent variables
forvalues i = 1 / $horizon {
local sc = `i'-1
gen Y`i' = 100*log(f`sc'.Y+1)
}

* Lags dependent variable
foreach v in Y {
forvalues l = 1 / 4 {
gen l`l'`v' = l`l'.`v'1
}
}

* Main explanatory variable
gen r2 = EPLregularworkers

* Lags and forwards of explanatory variables
forvalues s = 2 / 2 {
forvalues l = 1 / 4 {
gen l`l'r`s' = l`l'.r`s'
}
forvalues f = 1 / 5 {
gen f`f'r`s' = f`f'.r`s'
}
}

* Global for forward variables (Teulings and Zubanov)
forvalues s = 2/2 {
global f1`s'
global f2`s' f1r`s'
global f3`s' f1r`s' f2r`s'
global f4`s' f1r`s' f2r`s' f3r`s'
global f5`s' f1r`s' f2r`s' f3r`s' f4r`s'
global f6`s' f1r`s' f2r`s' f3r`s' f4r`s' f5r`s'
}

* EPL reform temporary contract, interacted with industry-specific characteristics
gen t2 = EPLtemporaryworkers

* Recession dummy
gen d_recession = 0 if NGDP_RPCH != .
replace d_recession = 1 if NGDP_RPCH < 0

************ ANALYSIS AND GRAPH - STRIKES **********

matrix baseline = J($horizon,4,.)

forvalues i= 1/$horizon {
xtreg  Y`i' r2 l1Y l2Y l3Y l4Y l1r2 l2r2 l3r2 l4r2 t2 d_recession ${f`i'2} i.year, fe robust
matrix results = r(table)
matrix baseline[`i',1] = results[1,1]
matrix baseline[`i',2] = results[2,1]
matrix baseline[`i',3] = results[1,1] + $ci*results[2,1]
matrix baseline[`i',4] = results[1,1] - $ci*results[2,1]
}
capture drop coeff2 ci_p2 ci_n2
matrix coeff2 = baseline[1...,"c1"]
matrix ci_p2 = baseline[1...,"c3"]
matrix ci_n2 = baseline[1...,"c4"]
svmat coeff2
svmat ci_p2
svmat ci_n2
capture drop horizon
egen horizon = group(year) 
replace horizon = . if coeff21==.

* Create graph
graph set window fontface "Times New Roman"
graph twoway line coeff2 ci_p2 ci_n2 horizon, graphregion(color(white)) ytitle("") xtitle("") yline(0, lcolor(black)) xlabel(, nolabels) legend(off) ///
lpattern(solid shortdash shortdash) lwidth (thick thick thick) lcolor(blue red red) ytitle("% change", height(5)) subtitle("{bf:Panel A.} Days lost due to strike activity") ysize(10) xsize(15)
graph copy A, replace
